package sys

import (
	"ginweb-admin/global"
)

// 系统用户表
type SysUser struct {
	global.Model
	UUID     string `gorm:"index;column:uuid;not null;default:'';comment:用户UUID" json:"uuid" structs:"-" ` // 用户UUID
	UserName string `gorm:"column:username;size:60;not null;default:'';comment:用户名" json:"username" structs:"username"`
	NickName string `gorm:"column:nickname;size:60;not null;default:'';comment:昵称" json:"nickname" structs:"nickname"`
	Account  string `gorm:"column:account;size:30;not null;default:'';comment:账号" json:"account" structs:"account"`
	Password string `gorm:"column:password;size:60;not null;default:'';comment:密码" json:"password" structs:"password"`
	Slat     string `gorm:"column:slat;size:100;not null;default:'';comment:密码加盐;" json:"slat" structs:"-" ` // 用户登录密码
	Avatar   string `gorm:"column:avatar;size:200;not null;default:'';comment:头像" json:"avatar" structs:"avatar"`
	Age      uint8  `gorm:"column:age;size:2;not null;default:0;comment:年龄" json:"age" structs:"age"`
	Sex      uint8  `gorm:"column:sex;size:2;not null;default:2;comment:性别 0女 1男 2 保密" json:"sex" structs:"sex"`
	Address  string `gorm:"column:address;size:100;not null;default:'';comment:地址" json:"address" structs:"address"`
	Phone    string `gorm:"column:phone;size:20;not null;default:'';comment:电话号码" json:"phone" structs:"phone"`
	Birthday string `gorm:"column:birthday;size:30;not null;default:'';comment:生日" json:"birthday" structs:"birthday"`
	Email    string `gorm:"column:email;size:30;not null;default:'';comment:用户邮箱" json:"email"  structs:"email" `
	Enable   int8   `gorm:"column:enable;size:1;not null;default:0;comment:用户是否被冻结 0正常 1冻结" json:"enable" structs:"enable" `
}

// 自定义表名
func (SysUser) TableName() string {
	return "sys_user"
}
